﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Modularity;

namespace Leo.Core.DevExtreme
{
    public class DevExtremeModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<Microsoft.AspNetCore.Mvc.MvcOptions>(options =>
            {
                if (options.ModelBinderProviders != null && options.ModelBinderProviders.FindIndex(x => x.GetType() == typeof(DevExtremeDataLoadOptionsBinderProvider)) < 0)
                {
                    options.ModelBinderProviders.Insert(0, new DevExtremeDataLoadOptionsBinderProvider());
                }
            });
        }
    }
}
